﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CarrDocuments.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="Assets/js/zoom.js"></script>
    <link rel="stylesheet" href="Assets/css/zoom.css" type="text/css" />
    <script type="text/javascript">
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(strID, strName) {
            if (confirm('Bạn có thực sự muốn xóa ' + strName + '?')) {
                var vnpage = getUrlVars()["page_number"];
                var vChar = getUrlVars()["letter"];
                var vType = getUrlVars()["type"];
                var strHref = "";
                if (vnpage)
                    strHref = "CarrDocuments.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    strHref = "CarrDocuments.aspx?action=delete&ID=" + strID;
                strHref += "&type=" + vType;
                if (vChar)
                    window.location.href = strHref + "&letter=" + vChar;
                else
                    window.location.href = strHref;
            }
        }
        $().ready(function () {
            $('#txtCarr').focus().autocomplete(carrs, { matchContains: true });
            $('#txtPort').focus().autocomplete(ports, { matchContains: true });
            $('table tbody tr').mouseover(function () {
                //$('.green').removeClass('green');
                $(this).children(".green").removeClass('green').addClass('new_green');
                $(this).children(".blue").removeClass('blue').addClass('new_blue');
            })
            $('table tbody tr').mouseout(function () {
                //$('.green').removeClass('green');
                $(this).children(".new_green").removeClass('new_green').addClass('green');
                $(this).children(".new_blue").removeClass('new_blue').addClass('blue');
            })
            // $("#maintable").SelectColumn({ buttonid: 'selectcolumn', usegroup: true, viewtype: "category", checkalltype: "checkbox", showgroupname: true });
            var nsuperAdmin = '<%Response.Write(nPermissions.ToString()); %>'
            if (nsuperAdmin < 9) $('#slAll').hide();

            $("#btnAddNew").click(function () {
                $("#addnewbox").show();
            });
        });     
    </script>
    <style type="text/css">
        .thheader
        {
            font-weight: bold;
            vertical-align: middle;
            text-align: center;
            font-size: 11px;
            border: 1px solid #ccc !important;
            line-height: 7px !important;
            width: 100px;
        }
        div.scroll
        {
            overflow: auto;
            border: 1px solid white;
            background-color: white;
            padding: 8px;
        }
        
        table td.maintable
        {
            background: #CBEFCB;
            color: Blue;
            font-size: 12px;
        }
        .adminedit table th
        {
            padding: 0px !important;
        }
    </style>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                CHI TIẾT LIÊN HỆ NGƯỜI LÀM
                <%=carrName %></h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmLocalCosts" runat="server">
                <%if (nPermissions >= 3)
                  {%>
                <div id="addnewbox">
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">
                            <%=carrName %>: Add [Edit]</h3>
                        <div class="clear">
                        </div>
                    </div>
                    <table class="adminedit" style="width: 100%;">
                        <tr style="background: #ECECEC;">
                            <th align="center" class="thheader">
                                CARRIER
                            </th>
                            <th align="center" class="thheader">
                                Location
                            </th>
                            <th align="center" class="thheader">
                                PORT
                            </th>
                            <%if (carrType == 1)
                              {%>
                            <th align="center" class="thheader">
                                DOC
                            </th>
                            <%}
                              else if (carrType == 2)
                              {%>
                            <th align="center" class="thheader">
                                CUS
                            </th>
                            <%}
                              else if (carrType == 3)
                              {%>
                            <th align="center" class="thheader">
                                KẾ TOÁN
                            </th>
                            <%}
                              else if (carrType == 4)
                              {%>
                            <th align="center" class="thheader">
                                OPER
                            </th>
                            <%}
                              else if (carrType == 5)
                              {%>
                            <th align="center" class="thheader">
                                DOC IMPORT
                            </th>
                            <%} %>
                            <th align="center" class="thheader">
                                PT TUYEN
                            </th>
                            <th align="center" class="thheader">
                                TEL
                            </th>
                            <th align="center" class="thheader">
                                MOBILE
                            </th>
                            <th align="center" class="thheader">
                                EMAIL
                            </th>
                            <th align="center" class="thheader">
                                <%if (carrType ==4){%>
                                CY
                                <%} else{ %>
                                SKYPE
                                <% }%>
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarr" runat="server" TabIndex="2" Width="150px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:DropDownList class="cls" ID="ddLocation" runat="server" Width="105px">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtPort" runat="server" TabIndex="3" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <%if (carrType == 1)
                              {%>
                            <td>
                                <asp:TextBox class="cls" ID="txtDoc" runat="server" TabIndex="4" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarrPTTuyen" runat="server" TabIndex="5" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarrTel" runat="server" TabIndex="6" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarrMobile" runat="server" TabIndex="7"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarrEmail" runat="server" TabIndex="8" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCarrSupport" runat="server" TabIndex="9" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <%}
                              else if (carrType ==2)
                              {%>
                            <td onmouseout="this.classname='green';">
                                <asp:TextBox class="cls" ID="txtCust" runat="server" TabIndex="10" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCustPTTuyen" runat="server" TabIndex="12" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCustTel" runat="server" TabIndex="13" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCustMobile" runat="server" TabIndex="14" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCustEmail" runat="server" TabIndex="15" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtCustSupport" runat="server" TabIndex="16" Width="137px"
                                    Style="text-align: right; width: 100px;"></asp:TextBox>
                            </td>
                            <%}
                              else if (carrType == 3)
                              {%>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccnt" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccntPTTuyen" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccntTel" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccntMobile" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccntEmail" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtAccntSkype" runat="server" TabIndex="16" Width="137px"
                                    Style="text-align: right; width: 100px;"></asp:TextBox>
                            </td>
                            <%}
                              else if (carrType == 4)
                              {%>
                            <td>
                                <asp:TextBox class="cls" ID="txtOper" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtOperPTTuyen" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtOperTel" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtOperMobile" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtOperEmail" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtOperSkype" runat="server" TabIndex="16" Width="137px"
                                    Style="text-align: right; width: 100px;"></asp:TextBox>
                            </td>
                            <%}
                              else if (carrType ==5)
                              {%>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImport" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImportPTTuyen" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImportTel" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImportMobile" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImportEmail" runat="server" TabIndex="16" Style="text-align: right;
                                    width: 100px;"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox class="cls" ID="txtDocImportSkype" runat="server" TabIndex="16" Width="137px"
                                    Style="text-align: right; width: 100px;"></asp:TextBox>
                            </td>
                            <%} %>
                        </tr>
                    </table>
                    <table class="paramlist admintable" width="100%">
                        <tr>
                            <td>
                                <asp:Label ID="lblError" CssClass="error" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button class="button" ID="btnSave" runat="server" TabIndex="17" Text="Save"
                                    OnClick="btnSave_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
                <%} %>
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                        <%=carrName %>
                    </h3>
                    <asp:DropDownList ID="ddPicSales" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddPicSales_SelectedIndexChanged">
                    </asp:DropDownList>
                    &nbsp;
                    <asp:DropDownList ID="ddCarriers" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCarriers_SelectedIndexChanged">
                    </asp:DropDownList>
                    <div class="clear">
                    </div>
                </div>
                <% if(nPermissions > 7)
                          { %>
                <%=strAlphaBet %>
                <%} %>
                <div class="scroll">
                    <fieldset>
                        <asp:Repeater ID="rptData" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#CBEFCB';" onmouseout="this.style.background='#ffffff'">
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td style="font-weight: bold;">
                                        <%# DataBinder.Eval(Container.DataItem, "Carr")%>
                                    </td>
                                    <td code="LocationName">
                                        <%# DataBinder.Eval(Container.DataItem, "LocationName") %>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Port")%>
                                    </td>
                                    <%if (carrType == 1)
                                      {%>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Doc")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CarrPTTuyen")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CarrTel")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CarrMobile")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CarrEmail")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CarrSupport")%>
                                    </td>
                                    <%}else if (carrType == 2){%>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Cust")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CustPTTuyen")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CustTel")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CustMobile")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CustEmail")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "CustSupport")%>
                                    </td>
                                    <%}else if (carrType == 3){%>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Accnt")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "AccntPTTuyen")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "AccntTel")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "AccntMobile")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "AccntEmail")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "AccntSkype")%>
                                    </td>
                                    <%}else if (carrType == 4){%>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Oper")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "OperPTTuyen")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "OperTel")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "OperMobile")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "OperEmail")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "OperSkype")%>
                                    </td>
                                    <%}else if (carrType == 5){%>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImport")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImportPTTuyen")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImportTel")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImportMobile")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImportEmail")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "DocImportSkype")%>
                                    </td>
                                    <%} %>
                                    <%if (nPermissions >= 3)
                                      {%>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                    </td>
                                    <%} %>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" id="maintable" cellpadding="0" width="100%" border="0" class="adminlist">
                                    <thead>
                                        <tr>
                                            <th align="center" width="30px">
                                                INDEX
                                            </th>
                                            <th align="center">
                                                CARRIER
                                            </th>
                                            <th align="center" width="80px">
                                                Location
                                            </th>
                                            <th align="center" class="unviewable" groupname="Doc">
                                                PORT
                                            </th>
                                            <%if (carrType == 1)
                                              {%>
                                            <th align="center" class="unviewable" groupname="Doc">
                                                DOC
                                            </th>
                                            <%}else if (carrType == 2){%>
                                            <th align="center" class="unviewable" groupname="Cus">
                                                CUS
                                            </th>
                                            <%}else if (carrType == 3){%>
                                            <th align="center" class="unviewable" groupname="Accnt">
                                                KẾ TOÁN
                                            </th>
                                            <%}else if (carrType ==4){%>
                                            <th align="center" class="unviewable" groupname="Accnt">
                                                Oper
                                            </th>
                                            <%}else if (carrType ==5){%>
                                            <th align="center" class="unviewable" groupname="Accnt">
                                                Doc Import
                                            </th>
                                            <%} %>
                                            <th align="center" class="unviewable" groupname="Doc">
                                                PT TUYEN
                                            </th>
                                            <th align="center" class="unviewable" groupname="Accnt">
                                                TEL
                                            </th>
                                            <th align="center" class="unviewable" groupname="Accnt">
                                                MOBILE
                                            </th>
                                            <th align="center" class="unviewable" viewstate="hidden" groupname="Accnt">
                                                EMAIL
                                            </th>
                                            <th align="center" class="unviewable" viewstate="hidden" groupname="Accnt">
                                                <%if (carrType ==4){%>
                                                CY
                                                <%} else{ %>
                                                SKYPE
                                                <% }%>
                                            </th>
                                            <%if(nPermissions>= 3)
                                              {%>
                                            <th align="center" width="100px">
                                                Action
                                            </th>
                                            <%} %>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                    </fieldset>
                </div>
                <div class="clear">
                </div>
                <div id="footer">
                    <%=strPager%>
                </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
